using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.Hr.Attendance;
using HengTong.Model.Db.Hr;


namespace HengTong.ViewModel.Hr.SysAttendanceRecordVms
{
    public partial class SysAttendanceRecordTemplateVm : BaseTemplateVM
    {
        public ExcelPropety PersonExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.PersonId);
        public ExcelPropety AttendanceShiftGroupExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.AttendanceShiftGroupId);
        [Display(Name = "班次类型")]
        public ExcelPropety ShiftTypeExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.ShiftType);
        [Display(Name = "排班方式")]
        public ExcelPropety ScheduleTypeExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.ScheduleType);
        [Display(Name = "班次状态")]
        public ExcelPropety StatusExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.Status);
        [Display(Name = "备注说明")]
        public ExcelPropety RemarkExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.Remark);
        public ExcelPropety SubstitutePersonExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.SubstitutePersonId);
        [Display(Name = "出勤结果")]
        public ExcelPropety AttendanceResultExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.AttendanceResult);
        [Display(Name = "迟到时长(分钟)")]
        public ExcelPropety LateMinutesExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.LateMinutes);
        [Display(Name = "早退时长(分钟)")]
        public ExcelPropety EarlyLeaveMinutesExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.EarlyLeaveMinutes);
        [Display(Name = "有效工时(分钟)")]
        public ExcelPropety WorkMinutesExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.WorkMinutes);
        [Display(Name = "缺卡次数")]
        public ExcelPropety MissingPunchCountExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.MissingPunchCount);
        [Display(Name = "是否异常")]
        public ExcelPropety IsAbnormalExcel = ExcelPropety.CreateProperty<SysAttendanceRecord>(x => x.IsAbnormal);

	    protected override void InitVM()
        {
            PersonExcel.DataType = ColumnDataType.ComboBox;
            PersonExcel.ListItems = DC.Set<SysPerson>().GetSelectListItems(Wtm, y => y.Name);
            AttendanceShiftGroupExcel.DataType = ColumnDataType.ComboBox;
            AttendanceShiftGroupExcel.ListItems = DC.Set<SysAttendanceShiftGroup>().GetSelectListItems(Wtm, y => y.Name);
            SubstitutePersonExcel.DataType = ColumnDataType.ComboBox;
            SubstitutePersonExcel.ListItems = DC.Set<SysPerson>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysAttendanceRecordImportVm : BaseImportVM<SysAttendanceRecordTemplateVm, SysAttendanceRecord>
    {

    }

}
